using System;
using Microsoft.Xna.Framework.Input;
using RpgXna.Model.XnaClassesWrappers;

namespace RpgXna.Model.Interfaces
{
    class KeysInputBehavior
    {
        protected Func<bool> Predicate;
        protected IKeyboardStateWrapper Prevkbs = new KeyboardStateWrapper(new KeyboardState(new Keys[] { }));
        protected IKeyboardStateWrapper CurKbs;

        protected bool KeyPressed(Keys k)
        {

            bool keyPressed = false;

            if (CurKbs.IsKeyDown(k))
            {
                if (Prevkbs.IsKeyUp(k))
                {
                    keyPressed = true;
                }
            }

            return keyPressed;

        }
    }
}